{% extends "./base.html" %}
{% load static from staticfiles %}
{% load  remainder %}
{%block main%}

<div class="c-c-mobile-product">
    <div class="c-c-m-p-title">
        <h2>产品展示</h2>
        <span>
            <i class="iconfont">&#xe611;</i>
        </span>
    </div>
    <div class="c-c-m-p-lists">
    {% for product in product_list %}
        <div class="c-c-m-p-l-list">
            <a href="{% url 'product_details' product.id %}?nav_id={{product_nav.id}}"><img src="{{product.img.url}}" alt="{{product.name}}"/></a>
            <p>{{product.name}}</p>
        </div>
    {%endfor%}
    </div>

</div>
<div class="c-c-mobile-nav">
    <div>
        <a href="#" target="_self">
            <i class="iconfont">&#xe604;</i>
            <h5>首页</h5>
        </a>
    </div>
    <div>
        <a href="/news/?nav_id=3" target="_self">
            <i class="iconfont">&#xe60a;</i>
            <h5>新闻</h5>
        </a>
    </div>
    <div>
        <a href="/common/message/?nav_id=2" target="_self">
            <i class="iconfont">&#xe603;</i>
            <h5>关于</h5>
        </a>
    </div>
    <div>
        <a href="/contact/message/?nav_id=7" target="_self">
            <i class="iconfont">&#xe608;</i>
            <h5>留言</h5>
        </a>
    </div>
</div>
<div class="c-c-mobile-news">
    <div class="c-c-m-p-title">
        <h2>新闻动态</h2>
        <span>
            <i class="iconfont">&#xe601;</i>
        </span>
    </div>
    <div class="c-c-m-n-lists">
        <ul>
        {% for new in news_list %}
        <div class="c-n-item">
           {%if forloop.counter <= 4 %}
                <li><i></i><a href="{% url 'new_details' new.id %}?nav_id={{new_nav.id}}" target="_self">{{new.title}}</a></li>
           {%endif%}
        </div>
        {%endfor%}
        </ul>
    </div>
</div>

<div class="c-enterprise">
        <div class="row">
            <div class="col-md-4 col-lg-4">
                <div class="c-e-table">
                    <ul class="c-e-lists">
                        {% for intro in company_list %}
                            {% if forloop.counter = 2 %}
                                <li class="active">
                            {%else%}
                                <li>
                            {%endif%}
                                    <div class="c-e-l-icon">
                                        <img src="{%static "/static/images/index-icon1.jpg" %} " alt="图标"/>
                                    </div>
                                    <div class="c-e-l-content">
                                        <h3>{{intro.name}}</h3>
                                        <h4>{{intro.acronym}}</h4>
                                        <p>{{intro.intro}}</p>
                                    </div>
                                </li>
                        {% endfor %}
                    </ul>
                </div>
            </div>

            <div class="col-md-8 col-lg-8">
                <div class="c-e-main">
                    <ul class="c-e-m-animate">
                    {% for intro in company_list %}
                        <li>
                            <h3>{{intro.name}}</h3>
                            <h4>{{intro.acronym}}</h4>
                                 <img src="{{intro.img.url}}" alt="{{intro.name}}"/>
                            <p>{{intro.intro}}</p>
                        </li>
                    {%endfor%}
                    </ul>
                </div>
            </div>
        </div>
</div>

<div class="c-strength">
    <div class="c-s-title">
        <h2>{{strength_nav.name}} <small>{{strength_nav.introduction}}</small></h2>
    </div>
    <div class="row">
        {% for subtitle in subtitle_list %}
            <div class="col-md-3 col-lg-3">
                <div class="c-s-lists">
                    <img src="{{subtitle.img.img.url}}" alt="简介"/>
                    <div class="c-s-l-content">
                        <span>0{{forloop.counter}}</span>
                        <h4>{{subtitle.name}}</h4>
                        <div class="c-e-l-c-btn">
                            <a href="{{strength_nav.url.url}}?nav_id={{subtitle.nav.id}}&subtitle={{subtitle.id}}" target="_self">查看更多 +</a>
                        </div>
                        {% autoescape off %}
                            <p>{{subtitle.content |  striptags | slice:"150"}}</p>
                        {%endautoescape%}
                    </div>
                </div>
            </div>
        {%endfor%}
    </div>
</div>

<div class="c-news">
    <div class="c-s-title">
        <h2>{{new_nav.name}} <small>{{new_nav.introduction}}</small></h2>
    </div>
    <div class="row">
        <div class="col-md-8 col-lg-8">
            <div id="owlcarousel" class="owl-carousel">
                {% for new in news_img %}
                    <div class="c-n-item">
                        <img src="{{new.img.img.url}}" alt="图片"/>
                             {% for key, value in new.NEWS.items %}
                                   {%if key == new.types %}
                                          <p>{{value}}:{{new.title}}</p>
                                   {%endif%}
                             {%endfor%}
                        <span></span>
                    </div>
                {%endfor%}
            </div>
        </div>
        <div class="col-md-4 col-lg-4">
            <div id="c-n-flash">加载中...</div>
            <div class="c-n-btn">
                <a href="#" target="_self">了解更多 ></a>
            </div>
        </div>
    </div>
    <div class="row">
        {% for new in news_list %}
            <div class="col-md-3 col-lg-3">
                <div class="c-n-lists">
                    <span>{{forloop.counter | conver_language}}</span>
                    <dl>
                        <dt><a href="{% url 'new_details' new.id %}?nav_id={{new_nav.id}}" target="_self">{{new.title}}</a></dt>
                        {% autoescape off%}
                        <small><dd>{{new.content | striptags | slice:"110"}}
                        {% endautoescape %}
                            {% if new.content|length > 100 %}
                                ...
                            {% endif %}
                        </dd></small>
                    </dl>
                    <p>[{{new.pub_time |date:"Y-m-d"}}]</p>
                </div>
            </div>
        {%endfor%}
    </div>
</div>

<div class="c-product">
    <div class="c-s-title">
        <h2>{{product_nav.name}} <small>{{product_nav.introduction}}</small></h2>
    </div>
    <div class="row">
        <div id="c-p-lists" class="owl-carousel">
        {% for product in product_list %}
            <div class="col-md-12 col-lg-12">
                <div class="c-p-l-list hover_box">
                    <a href="{% url 'product_details' product.id %}?nav_id={{product_nav.id}}" target="_self">
                        <img src="{{product.img.url}}" alt="{{product.name}}"/>
                        <p>{{product.name}}</p>
                    </a>
                </div>
            </div>
        {%endfor%}
        </div>
    </div>
</div>

{% endblock %}
